<?php

/**
 * 基础信息
 */
class RegBasicInfo extends Reg
{
    public $step = 'step1';
    public function stepNext($user)
    {
        //第一步，需要稍作处理
        //把用户信息保存到数据库，此处模拟保存到session
        if ($user == null){
            $user = new UserEntity();
            $user->userName = $_POST['name'] ?? '';
            $user->userPass = $_POST['pass'] ?? '';
            //模拟入库
            $_SESSION['user'] = json_encode($user);
        }
        $getUser = parent::stepNext($user); // TODO: Change the autogenerated stub
        //保存用户信息
        if ($getUser){
            //流转到下一步获取用户信息，主要是含用户状态信息
            $_SESSION['user'] = json_encode($getUser);
        }
    }
}